package org.shj.basic

trait Action{
  def doSomething
}

trait BeforeAfter extends Action{
  abstract override def doSomething{
    println("Before invoke real doSomething()")
    super.doSomething
    println("After invoke real doSomething()")
  }
}

class RealAction extends Action{
  override def doSomething = println("Working...")
}

object AOPDemo {
  def main(args: Array[String]): Unit = {
    val act = new RealAction with BeforeAfter
    act.doSomething
  }
  
}